package designpattern.decorator;

import designpattern.adapter.object.DeerApater2;

/**
 * TODO:类描述
 *
 * @className: DecoratorCar
 * @packageName: designpattern.decorator
 * @author: Zhuhj
 * @version: V1.0
 * @date: 2021/4/20 21:20
 */
public class DecoratorCar extends Car{
    protected Car c;
    protected double decoratorCost;
    protected String decoratorDesc;
    public void setCar(Car car){
        this.c = car;
    }
    @Override
    public double getCost() {
        return decoratorCost+c.getCost();
    }

    @Override
    public String getDesc() {
        return c.getDesc() + this.decoratorDesc;
    }
}
